<template>
  <!--  border-style（边框样式） solid 实线  #color-->
  <div style="height: 50px; line-height: 50px; border-bottom: 1px solid #cccccc; display: flex">
    <div style="

    width: 400px;
    font-size: 25px;
    font-weight: bold;
    position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            margin: auto;
            color: deepskyblue;">郑州财经学院后台管理系统
    </div>
    <!--    弹性布局平均分配空间,代表平均分配元素空间-->
    <div style="flex: 1"></div>

    <div>
      <el-dropdown style="display: flex;margin-top: 10px">
       <span class="el-dropdown-link">
         用户名 : {{ user.username }}
         <el-icon class="el-icon--right">
        <arrow-down/>
      </el-icon>
       </span>
        <template #dropdown>
          <el-dropdown-menu>
            <!--            <el-dropdown-item @click="$router.push('/person')">个人信息</el-dropdown-item>-->
            <el-dropdown-item @click=logout>退出系统</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </div>
  </div>

</template>


<script>
//图标
import {ArrowDown} from '@element-plus/icons'

export default {
  //图标注册
  components: {
    ArrowDown
  },
  name: "Header",
  props: ['user'],
  data() {
    return {}
  },
  created() {
  },
  methods: {
    logout() {
      this.$router.push('/login');
      localStorage.clear();
    }
  }
}
</script>

<style scoped>

</style>
